{% extends "tool/base_tool.html" %}
{% load static %}

{% block head_title %}网页HTTP请求头Request Headers在线生成User-Agent_在线工具{% endblock %}
{% block metas %}
<meta name="description"
      content="User-Agent生成器，网页请求头生成器，自动生成请求头Request Headers，在线生成各种浏览器ie、chrome、firefox等的请求头user-agent，Python爬虫的headers参数自动生成。">
<meta name="keywords" content="网页请求头,Request Headers,User-Agent,在线工具">
{% endblock %}

{% block tool_name %}User-Agent 生成器{% endblock %}
{% block left_content %}
<div class="card-body p-0">
    <h3 class="card-title pl-2 title-info">工具说明：</h3>
    <ul>
        <li>User-Agent多用于爬虫程序中设置请求头Headers，是爬虫程序最简单的伪装</li>
        <li>本工具通过设置不同的参数自动生成不同平台不同系统不同浏览器的User-Agent</li>
        <li>参数不选的时候表示不设置限制，随机生成User-Agent，设置了参数就生成对应参数的User-Agent</li>
        <li>当设置的参数之间有冲突的时候，将无法生成合适的User-Agent，会显示错误信息</li>
    </ul>
</div>
<div class="mb-3">

    <form class="form-horizontal">
        <h3 class="card-title pl-2 title-info">请求头参数选择</h3>
        <div class="control-group">
            <label class="control-label">设备：</label>
            <div class="controls" id="device_type">
                <label class="checkbox inline"><input class="ml-2 mr-3" name="device_type" type="checkbox"
                                                      value="desktop">desktop</label>
                <label class="checkbox inline"><input class="ml-2 mr-3" name="device_type" type="checkbox"
                                                      value="tablet">tablet</label>
                <label class="checkbox inline"><input class="ml-2 mr-3" name="device_type" type="checkbox"
                                                      value="smartphone">smartphone</label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">系统：</label>
            <div class="controls" id="os">
                <label class="checkbox inline"><input class="ml-2 mr-3" name="os" type="checkbox"
                                                      value="win">win</label>
                <label class="checkbox inline"><input class="ml-2 mr-3" name="os" type="checkbox"
                                                      value="linux">linux</label>
                <label class="checkbox inline"><input class="ml-2 mr-3" name="os" type="checkbox"
                                                      value="mac">mac</label>
                <label class="checkbox inline"><input class="ml-2 mr-3" name="os" type="checkbox" value="android">android</label>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label">浏览器：</label>
            <div class="controls" id="navigator">
                <label class="checkbox inline"><input class="ml-2 mr-3" name="navigator" type="checkbox"
                                                      value="ie">ie</label>
                <label class="checkbox inline"><input class="ml-2 mr-3" name="navigator" type="checkbox" value="chrome">chrome</label>
                <label class="checkbox inline"><input class="ml-2 mr-3" name="navigator" type="checkbox"
                                                      value="firefox">firefox</label>
            </div>
        </div>
    </form>
    <button type="submit" class="btn btn-info btn-sm rounded-0" id="get_useragent">生成 User-Agent</button>
</div>
<div class="card mb-3 rounded-0">
    <div class="card-header text-center text-info font-weight-bold py-2">User-Agent</div>
    <div class="card-body push-result text-center p-3">结果显示区</div>
</div>
{% endblock %}

{% block end_f %}
<script>
$("#get_useragent").click(function(){
    useragent_api("{{ csrf_token }}","{% url 'tool:useragent' %}")
})
</script>
{% endblock %}